<template>
	<view style="flex: 1;">
		<!--地址-->
		<template v-if="!extract_store.store_id">
			<view class="d-b-c store-item-info" @click="addAddress()">
				<view class="add-info d-s-c">
					<view class="icon-box mr10">
						<text class="icon iconfont icon-dizhi"></text>
					</view>
					<text class="f28 gray3">请选择自提点</text>
				</view>
				<text class='iconfont icon-jiantou'></text>
			</view>
		</template>
		<template v-else>
			<view class="d-b-c store-item-info" @click="addAddress()">
				<view class="add-info">
					<view class="info d-s-s mb16">
						<text class="tips-box theme-borderbtn">当前自提点</text>
						<view class="f24 gray9 d-s-s flex-1">
							<text>{{ extract_store.region.province }}</text>
							<text>{{ extract_store.region.city }}</text>
							<text>{{ extract_store.region.region }}</text>
						</view>
					</view>
					<view class="f28 gray3 mb16">{{ extract_store.store_name }}</view>
					<view class="f24 gray9">
						<text>{{ extract_store.address }}</text>
						<text class="ml10">{{ extract_store.phone }}</text>
					</view>
				</view>
				<text class='iconfont icon-jiantou'></text>
			</view>
		</template>
		<Adress :isAddress='isAddress' :chooseSotr='chooseSotr' :store_id='store_id' @close="closeAdress"></Adress>
		<!-- 		<view class="addree-bottom">
			<view class="stripe" v-for="(item, index) in 10" :key="index">
				<text :class="index % 2 == 0 ? 'red' : 'blue'"></text>
				<text class="white"></text>
			</view>
		</view> -->
	</view>
</template>

<script>
	import Adress from './address/address';
	export default {
		data() {
			return {
				isAddress: false,
				store_id: 0
			};
		},
		components: {
			Adress,
		},
		props: ['extract_store', 'last_extract', 'chooseSotr'],
		onLoad() {

		},
		mounted() {

		},
		methods: {
			/*添加地址*/
			addAddress() {
				let store_id = -1;
				if (this.extract_store.store_id) {
					store_id = this.extract_store.store_id;
				}
				this.store_id = store_id
				this.isAddress = true;
			},
			closeAdress() {
				this.isAddress = false;
			}
		}
	};
</script>

<style lang="scss" scoped>
	.add-info {
		padding: 34rpx 0;
	}

	.buy-checkout.vender .item .key {
		width: 200rpx;
	}

	.store-item-info {
		padding-right: 0;
		margin-bottom: 34rpx;
		border-bottom: 1px solid #eee;
		.icon.iconfont {
			font-size: 32rpx;
			color: #333;
		}

		.icon-jiantou {
			font-size: 26rpx;
			color: #999;
		}
	}

	.tips-box {
		width: 123rpx;
		height: 30rpx;
		line-height: 30rpx;
		border-radius: 5rpx;
		text-align: center;
		display: flex;
		justify-content: center;
		align-items: center;
		margin-right: 9rpx;
		font-size: 22rpx;
	}
</style>